package com.foton.lotteryinfrastructure.infrastru.dao;

import com.foton.dbrouterstarter.annotation.DBRouter;
import com.foton.lotteryinfrastructure.infrastru.po.UserTakeActivity;
import org.apache.ibatis.annotations.Mapper;

/**
 * @Author RenPu
 * @Date 2023/12/12 18:54
 * @Version 1.0
 * @Description:
 **/

@Mapper
public interface IUserTakeActivityDao {

    @DBRouter(key = "uId")
    void insert(UserTakeActivity userTakeActivity);


    /**
     *  根据用户ID和活动ID查询已经领取的活动单，没有进行参与
     * @param userTakeActivity
     * @return
     */
    UserTakeActivity queryNoConsumedTakeActivityOrder(UserTakeActivity userTakeActivity);


    /**
     *  尝试锁定活动领取记录
     * @param userTakeActivity
     * @return
     */
    int lockTackActivity(UserTakeActivity userTakeActivity);
}
